package com.liao.badminton.vo;

import com.liao.badminton.code.BaseField;
import io.swagger.annotations.ApiModelProperty;
import java.lang.String;
import java.util.Date;
import java.util.List;
import lombok.Data;
import com.liao.badminton.entity.FileShard;
/**
* @author liaocheng
* @date 2024-11-01
* description:文件
*/
@Data
public class FileShardVo  extends BaseField {

    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "相对路径")
    private String path;

    @ApiModelProperty(value = "文件名")
    private String name;

    @ApiModelProperty(value = "后缀")
    private String suffix;

    @ApiModelProperty(value = "大小|字节B")
    private Integer size;

    @ApiModelProperty(value = "已上传分片")
    private Integer shardIndex;

    @ApiModelProperty(value = "分片大小|B")
    private Integer shardSize;

    @ApiModelProperty(value = "分片总数")
    private Integer shardTotal;

    @ApiModelProperty(value = "文件标识")
    private String fileMd;

    private List<Long> delIds;  //批量删除ids

    public static FileShardVo invertToVo(FileShard fileShard){
        FileShardVo vo = new FileShardVo();
        BaseField.invert(fileShard, vo);
        vo.setId(fileShard.getId());
        vo.setPath(fileShard.getPath());
        vo.setName(fileShard.getName());
        vo.setSuffix(fileShard.getSuffix());
        vo.setSize(fileShard.getSize());
        vo.setShardIndex(fileShard.getShardIndex());
        vo.setShardSize(fileShard.getShardSize());
        vo.setShardTotal(fileShard.getShardTotal());
        vo.setFileMd(fileShard.getFileMd());
        return vo;
    }
}
